const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  runtimeCompiler: true,
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'scss',
      patterns: []
    }
  },
  chainWebpack: config => {
    config.optimization.runtimeChunk('single') // 对于Vue CLI 3+

    config
      .output
      .filename('[name].[contenthash].[timestamp].js')
      .chunkFilename('[name].[contenthash].[timestamp].js');

    // 如果想添加时间戳，可以使用环境变量，但需要在构建时动态设置
    // config.output.filename('[name].[contenthash].[timestamp].js');
    // config.output.chunkFilename('[name].[contenthash].[timestamp].js');
  },
})
